﻿#include<dataSet.h>

//遍历该目录下的.jpg图片
//void load_data_from_folder(std::string path, std::string type, std::vector<std::string> &list_images, std::vector<int> &list_labels, int label)
//{
//    long long hFile = 0; //句柄
//    struct _finddata_t fileInfo;
//    std::string pathName;
//    if ((hFile = _findfirst(pathName.assign(path).append("\\*.*").c_str(), &fileInfo)) == -1)
//    {
//        return;
//    }
//    do
//    {
//        const char* s = fileInfo.name;
//        const char* t = type.data();

//        if (fileInfo.attrib&_A_SUBDIR) //是子文件夹
//        {
//            //遍历子文件夹中的文件(夹)
//            if (strcmp(s, ".") == 0 || strcmp(s, "..") == 0) //子文件夹目录是.或者..
//                continue;
//            std::string sub_path = path + "\\" + fileInfo.name;
//            label++;
//            load_data_from_folder(sub_path, type, list_images, list_labels, label);

//        }
//        else //判断是不是后缀为type文件
//        {
//            if (strstr(s, t))
//            {
//                std::string image_path = path + "\\" + fileInfo.name;
//                list_images.push_back(image_path);
//                list_labels.push_back(label);
//            }
//        }
//    } while (_findnext(hFile, &fileInfo) == 0);
//    return;
//}
